package com.zrar.ak.gkpt.dao;

import com.zrar.ak.gkpt.model.bo.BusinessAccountExpandInfoBO;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

/**
 * @InterfaceName: IBusinessAccountBasicInfoDao
 * @Description 台账拓展信息Dao层
 * @Author liyang
 * @Time 2020/04/02
 */
@Repository("businessAccountExpandInfoDao")
public interface IBusinessAccountExpandInfoDao extends Mapper<BusinessAccountExpandInfoBO> {

    @Select(("SELECT COUNT(1) AS TOTAL FROM BUSINESS_ACCOUNT_EXPAND_INFO WHERE IS_DELETE='0' AND UNIT_ID=#{unitId}"))
    Integer queryExistCountByAccountExpandInfoUnitId(String unitId);

    @Update("UPDATE BUSINESS_ACCOUNT_EXPAND_INFO SET IS_DELETE='1' WHERE IS_DELETE='0' AND UNIT_ID = #{unitId}")
    void deleteAccountExpandInfoByUnitId(String unitId);
}
